<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Hello</title>
</head>
<body>

<!-- 文本内联-->
<div th:inline="text">
    <p>Hello，[[${userName}]]！</p>
    <br>
</div>

<!-- 脚本内联-->
<script th:inline="javascript">
    var msg = "Hello " + [[${userName}]] + "！";
    alert(msg);
</script>
</body>
</html>